package com.xiaoxing.gongqiju.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.gongqiju.R;
import com.xiaoxing.gongqiju.mvp.ui.entity.LiaoCheng_GongQiJu_KuCunLieBiao;

import java.util.List;

//import me.jessyan.armscomponent.commonres.utils.GlideUtil;


public class LiaoCheng_GongQiJu_KuCunLieBiaoAdapter extends BaseQuickAdapter<LiaoCheng_GongQiJu_KuCunLieBiao.DataBean, BaseViewHolder> {

    private Context mContext;
    private ILiaoCheng_GongQiJu_KuCunLieBiaoAdapter iLiaoCheng_gongQiJu_kuCunLieBiaoAdapter;

    public LiaoCheng_GongQiJu_KuCunLieBiaoAdapter(Context context, @Nullable List<LiaoCheng_GongQiJu_KuCunLieBiao.DataBean> data, ILiaoCheng_GongQiJu_KuCunLieBiaoAdapter iLiaoCheng_gongQiJu_kuCunLieBiaoAdapter) {
        super(R.layout.item_liao_cheng__gong_qi_ju__ku_cun_lie_biao, data);
        this.mContext = context;
        this.iLiaoCheng_gongQiJu_kuCunLieBiaoAdapter = iLiaoCheng_gongQiJu_kuCunLieBiaoAdapter;
    }

    @Override
    protected void convert(BaseViewHolder helper, LiaoCheng_GongQiJu_KuCunLieBiao.DataBean item) {
        //GlideUtil.loadImage(mContext,item.getImg(),helper.getView(R.id.img_head));
        helper.setText(R.id.tv_gong_ju_ming_cheng, "工具名称：" + item.getMaterialtoolname());
        helper.setText(R.id.tv_cang_wei_ming_cheng, "仓位名称：" + item.getSpname());
        helper.setText(R.id.tv_ku_cun, "库存：" + item.getExistnum());
        helper.setText(R.id.tv_dan_wei, "单位：" + item.getUnit());
        helper.setText(R.id.tv_wu_liao_da_lei_ming_cheng, "物料大类名称：" + item.getMaterialClassName());
        helper.setOnClickListener(R.id.btn_da_yin_er_wei_ma, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                iLiaoCheng_gongQiJu_kuCunLieBiaoAdapter.daYinErWeiMa(item);
            }
        });
    }

    public interface ILiaoCheng_GongQiJu_KuCunLieBiaoAdapter {

        void daYinErWeiMa(LiaoCheng_GongQiJu_KuCunLieBiao.DataBean item);
    }

}
